home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-ARM / PROC-ARM.{21 / PAGE.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  74 lines

  1. /*
  2.  * linux/include/asm-arm/proc-armv/page.h
  3.  *
  4.  * Copyright (C) 1995, 1996 Russell King
  5.  */
  6.  
  7. #ifndef __ASM_PROC_PAGE_H
  8. #define __ASM_PROC_PAGE_H
  9.  
  10. #include <asm/hardware.h>
  11.  
  12. /* PAGE_SHIFT determines the page size */
  13. #define PAGE_SHIFT    12
  14. #define PAGE_SIZE       (1UL << PAGE_SHIFT)
  15. #define PAGE_MASK       (~(PAGE_SIZE-1))
  16.  
  17. #ifdef __KERNEL__
  18.  
  19. #define STRICT_MM_TYPECHECKS
  20.  
  21. #ifdef STRICT_MM_TYPECHECKS
  22. /*
  23.  * These are used to make use of C type-checking..
  24.  */
  25. typedef struct { unsigned long pte; } pte_t;
  26. typedef struct { unsigned long pmd; } pmd_t;
  27. typedef struct { unsigned long pgd; } pgd_t;
  28. typedef struct { unsigned long pgprot; } pgprot_t;
  29.  
  30. #define pte_val(x)      ((x).pte)
  31. #define pmd_val(x)      ((x).pmd)
  32. #define pgd_val(x)      ((x).pgd)
  33. #define pgprot_val(x)   ((x).pgprot)
  34.  
  35. #define __pte(x)        ((pte_t) { (x) } )
  36. #define __pmd(x)        ((pmd_t) { (x) } )
  37. #define __pgd(x)        ((pgd_t) { (x) } )
  38. #define __pgprot(x)     ((pgprot_t) { (x) } )
  39.  
  40. #else
  41. /*
  42.  * .. while these make it easier on the compiler
  43.  */
  44. typedef unsigned long pte_t;
  45. typedef unsigned long pmd_t;
  46. typedef unsigned long pgd_t;
  47. typedef unsigned long pgprot_t;
  48.  
  49. #define pte_val(x)      (x)
  50. #define pmd_val(x)      (x)
  51. #define pgd_val(x)      (x)
  52. #define pgprot_val(x)   (x)
  53.  
  54. #define __pte(x)        (x)
  55. #define __pmd(x)        (x)
  56. #define __pgd(x)        (x)
  57. #define __pgprot(x)     (x)
  58.  
  59. #endif
  60.  
  61. /* to align the pointer to the (next) page boundary */
  62. #define PAGE_ALIGN(addr)    (((addr)+PAGE_SIZE-1)&PAGE_MASK)
  63.  
  64. /* This handles the memory map.. */
  65. #ifndef PAGE_OFFSET
  66. #define PAGE_OFFSET        0xc0000000
  67. #endif
  68.  
  69. #define MAP_NR(addr)        (((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT)
  70.  
  71. #endif /* __KERNEL__ */
  72.  
  73. #endif /* __ASM_PROC_PAGE_H */
  74.